var mine = new Vue({
	el:"#app",
	data:{
		user:{},
		order:{}
	},
	methods:{
		getOrderCount:function(){
			wx.showLoading({title:"加载中..."});
			this.$http.post(baseUrl+"order/status/count")
			.then(function(e){
				wx.hideLoading();
				var d = e.data;
				if(!d.success){
					wx.showToast({title:d.description});
					return;
				}
				this.order = d.data;
			}).catch(function(e){
				wx.hideLoading(), wx.showToast({
					title: "网络错误，请稍后重试",
					icon: "none",
					duration: 2e3,
					mask: !0
				});
			})
		},
		getUserInfo:function(){
			var userData = localStorage.getItem("user_data");
			this.user = JSON.parse(userData);
		},
	},
	created:function(){
		// 检测用户登录没得
		login._2page();
		this.getUserInfo();
		this.getOrderCount();
	}
});